/* 布局样式 - 页面布局相关样式 */

/* ===== 容器布局 ===== */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-lg);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.container-lg {
  max-width: 1024px;
}

.container-xl {
  max-width: 1280px;
}

/* ===== 网格布局 ===== */

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.grid-rows-1 { grid-template-rows: repeat(1, 1fr); }
.grid-rows-2 { grid-template-rows: repeat(2, 1fr); }
.grid-rows-3 { grid-template-rows: repeat(3, 1fr); }

/* ===== 页面布局 ===== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--spacing-lg) 0;
}

.page-main {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

.page-footer {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--backdrop-blur-light);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--spacing-lg) 0;
  text-align: center;
  color: var(--text-light);
}

/* ===== 导航布局 ===== */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-item {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-regular);
  text-decoration: none;
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(64, 158, 255, 0.1);
}

/* ===== 侧边栏布局 ===== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  z-index: var(--z-index-modal);
  transform: translateX(-100%);
  transition: var(--transition-base);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  height: calc(100vh - 80px);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-index-modal) - 1);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== 主内容布局 ===== */

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
  min-height: calc(100vh - 120px);
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.content-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  transition: var(--transition-base);
}

.content-card:hover {
  box-shadow: var(--shadow-heavy);
  transform: translateY(-2px);
}

/* ===== 表单布局 ===== */

.form-layout {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.form-section {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius-small);
  padding: var(--spacing-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: var(--backdrop-blur-light);
  transition: var(--transition-base);
}

.form-section:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.form-grid {
  display: grid;
  gap: var(--spacing-md);
}

.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-row {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-end;
}

.form-col {
  flex: 1;
}

/* ===== 结果布局 ===== */

.result-layout {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.result-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  transition: var(--transition-base);
}

.result-card:hover {
  box-shadow: var(--shadow-heavy);
  transform: translateY(-2px);
}

/* ===== 响应式布局 ===== */

@media screen and (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .result-layout {
    order: -1;
  }
  
  .grid-cols-4,
  .grid-cols-5,
  .grid-cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .main-content {
    padding: var(--spacing-lg) var(--spacing-md);
    gap: var(--spacing-md);
  }
  
  .nav {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }
  
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5,
  .grid-cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .main-content {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-item {
    width: 100%;
    text-align: center;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-5,
  .grid-cols-6 {
    grid-template-columns: 1fr;
  }
} 